AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

function ENT:Initialize()
	self.BaseClass.Initialize(self)
	
	if math.Rand(0, 1) > .75 then //hemp plant
		self.Color = Color(200, 255, 200, 255)
		self:SetColor(self.Color.r, self.Color.b, self.Color.g, self.Color.a)
		self.HP = 15
		self.Pay = self.HempPay
		Notify(self.dt.Owner, 1, 3, "unluckily for you, it's hemp. You might as well destroy it.")
		self.dt.Upgrade = 2
		//lol they cant upgrade and get more money.
	end
end

function ENT:Use(activator, caller)
	self.Active = true
	self:CreateTimers()
	self:SetColor(self.Color.r, self.Color.b, self.Color.g, self.Color.a)
end

function ENT:CreateTimers()
	timer.Create(tostring(self) .. "payday", self.PayDayTime, 0, self.PayDay, self)
	timer.Create(tostring(self) .. "warnturnoff", self.TurnOffTime - (self.TurnOffTime * 0.1), 1, self.WarnTurnOff, self)
	timer.Create(tostring(self) .. "turnoff", self.TurnOffTime, 1, self.TurnOff, self)
end

function ENT:OnRemove()
	timer.Remove(tostring(self) .. "payday")
	timer.Remove(tostring(self) .. "warnturnoff")
	timer.Remove(tostring(self) .. "turnoff")
end